package site.luojie.service.consumer;


import org.springframework.context.support.ClassPathXmlApplicationContext;
import site.luojie.service.api.WorkService;

import java.io.IOException;


/**
 * @author jie.luo
 * @since 2020/8/31
 */
public class ConsumerMain {
    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/dubbo-consumer.xml");
        context.start();

        WorkService workService = (WorkService) context.getBean("workService");
        int i = 1;
        while (true) {
            System.in.read();
            for (int j = 0; j < 1000; j++) {
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        workService.doWork("world");
                        workService.doWork1("world1");
                        workService.doWork2("world2");
                    }
                }).start();
            }
        }
    }
}
